import instance from '@/utils/request'

export function Register(data = {}) {
<<<<<<< HEAD
    return instance.request({
        method: 'POST',
        url: '/api/accounts/register',
        data
=======
    // 如果是FormData，需要特殊处理
    const isFormData = data instanceof FormData;
    return instance.request({
        method: 'POST',
        url: '/accounts/register',
        data,
        headers: isFormData ? {
            'Content-Type': 'multipart/form-data'
        } : {}
>>>>>>> resume
    })
}

export function Login(data = {}) {
    return instance.request({
        method: 'POST',
<<<<<<< HEAD
        url: '/api/accounts/login',
=======
        url: '/accounts/login',
>>>>>>> resume
        data
    })
}

export function Logout(data = {}) {
    return instance.request({
        method: 'PUT',
<<<<<<< HEAD
        url: '/api/accounts/logout',
=======
        url: '/accounts/logout',
>>>>>>> resume
        data
    })
}